/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/

#ifdef __cplusplus
extern "C" {
#endif


#ifndef __FLGR_DATA_TOOLS_LIST_H
#define __FLGR_DATA_TOOLS_LIST_H
 
#include <flgrCoreDll.h>
 
  typedef struct TLink TLink; 

  struct TLink { 
    void *elt; 
    TLink *next; 
    TLink *previous; 
  }; 

  /*! 
   * Linked list head
   */  
  typedef struct { 
    /*! Pointer on the first and last element of the List */
    TLink *start,*end; 
    /*! Linked List number of elements */
    int nbelt; 
    /*! User defined field */
    int field;
  } FLGR_List; 
  

  EXPORT_LIB int flgr_list_is_empty(FLGR_List *l);
  EXPORT_LIB int flgr_list_size(FLGR_List *l);
  EXPORT_LIB FLGR_List *flgr_list_create();

  EXPORT_LIB void flgr_list_add_Head(FLGR_List *l,void *elt);  
  EXPORT_LIB void flgr_list_add_tail(FLGR_List *l,void *elt);
  
  EXPORT_LIB void flgr_list_del_head(FLGR_List *l);
  EXPORT_LIB void flgr_list_del_tail(FLGR_List *l);
  EXPORT_LIB void flgr_list_destroy(FLGR_List *l);
  
  EXPORT_LIB void *flgr_list_get_head(FLGR_List *l);
  EXPORT_LIB void *flgr_list_get_tail(FLGR_List *l);

  EXPORT_LIB void flgr_list_stack_push(FLGR_List *l,void *elt);
  EXPORT_LIB void *flgr_list_stack_pop(FLGR_List *l);  
  EXPORT_LIB void flgr_list_queue_add(FLGR_List *l,void *elt);
  EXPORT_LIB void *flgr_list_queue_get(FLGR_List *l);

 


#endif 

#ifdef __cplusplus
}
#endif
